home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
F1 Licenseware
/
F1 Licenseware - Volume 1.iso
/
disks
/
089a.dms
/
089a.adf
/
EXAMPLE_PROGRAMS
/
example15.AMOS
/
example15.amosSourceCode
Wrap
AMOS Source Code
|
1992-03-06
|
2KB
|
76 lines
'=================
Rem example15.amos
'=================
Rem An example of selecting options with a mouse
'-----------------------------------------------
Rem Open a hires screen
'-----------------------
Screen Open 0,640,200,8,Hires
Rem set up mouse and screen colours
'-----------------------------------
Change Mouse 2 : Paper 6 : Curs Off : Cls 6
Rem set underlined text to on and print a centered message.
'----------------------------------------------------------
Under On
Centre "Move the mouse pointer over a box and click the left button"
Rem now turn underlined text off, so as not to affect any further text.
'----------------------------------------------------------------------
Under Off
Rem reserve some zones for four boxes.
'-------------------------------------
Reserve Zone 4
Rem Set the print position for where we want the box placed
Rem then print the box using border$ the last number is box type.
'----------------------------------------------------------------
Locate 20,10 : Print Border$(Zone$("BOX 1",1),1)
Locate 30,10 : Print Border$(Zone$("BOX 2",2),2)
Locate 40,10 : Print Border$(Zone$("BOX 3",3),3)
Locate 50,10 : Print Border$(Zone$("EXIT",4),4)
Rem this is the start of the main loop, look up DO LOOP in your notes.
'---------------------------------------------------------------------
Do
Rem wait for a mouse button to be pressed.
'----------------------------------------
While Mouse Key=0 : Wend
Rem set the variable kk to hold the number of the zone the mouse pointer
Rem was over when the button was clicked.
'------------------------------------------------------------------------
KK=Mouse Zone
Rem set text cursor
'------------------
Locate 0,20
Rem if mouse zone is over box 1 (kk=1) then print centered on screen "box 1".
Rem and so on.
'----------------------------------------------------------------------------
If KK=1 Then Centre "You selected BOX 1"
If KK=2 Then Centre "You selected BOX 2"
If KK=3 Then Centre "You selected BOX 3"
If KK=4 Then Centre "You selected EXIT!" : Wait 50 : Edit
Rem jump back to the start of the DO LOOP and start checking the mouse again
'---------------------------------------------------------------------------
Loop